<template>
	<view class="coupon">
		<!-- 我的优惠券列表 -->
		<u-navbar leftIconSize="34rpx" autoBack :placeholder="true" bgColor="#ffffff">
			<view class="" slot="center">
				<text class="c-000 pf-sc fw-600" style="font-size: 34rpx;">我的优惠券</text>
			</view>
		</u-navbar>
		<view
			class="set-data-container w-750 b-box d-flex flex-c ali-i-c  bg-fa po-re"
			:style="{ height: containerHeight }"
		>
			<scroll-view scroll-y="true" :style="{ height: containerHeight }">
				<view v-if="AnalogData.length" class="w-750 b-box" style="padding:20rpx 32rpx;">
					<coupon
						v-for="(item, index) of AnalogData"
						:key="item.id"
            :item="item"
					/>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
import {mycoupon } from '@/common/api.js';
import { _containerHeight } from '@/utils/GetSys.js';
import CoUpon from '../components/Coupon/Coupon';
import Unavbar from '../components/uview-ui/components/u-navbar/u-navbar';
export default {
	components: {
		coupon: CoUpon,
		'u-navbar': Unavbar
	},
	data() {
		return {
			containerHeight: '',
			AnalogData: []
		};
	},
	methods: {},
	onLoad() {
		this.containerHeight = _containerHeight();
		//渲染我的优惠券列表
		let params={
			token:uni.getStorageSync('usertoken')
		}
		mycoupon(params).then((res)=>{
			console.log(res);
			this.AnalogData=res.data.data
		})
	}
};
</script>

<style lang="scss">
.coupon {
}
</style>
